package review.action;

import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import review.entity.model.Test3StateEnum;

@Controller
@Api(value = "枚举数据获取API接口", tags = { "枚举Test3StateEnum读取接口" })
@RequestMapping("/sysdata")
public class EnumTest3StateEnumAction {

  @ResponseBody
  @ApiOperation(value = "枚举 Test3StateEnum Model", notes = "", httpMethod = "GET")
  @RequestMapping(value = "/test3stateenum", produces = "application/json")
  public Object findTest3StateEnumModel() {
    List<JSONObject> array = new ArrayList<>();
    for (Test3StateEnum h : Test3StateEnum.values()) {
      JSONObject obj = new JSONObject();
      obj.put("label", h.name());
      obj.put("value", h.ordinal());
      array.add(obj);
    }
    return array;
  }

}
